{layout name="layout2" /}
<script src="__PUBLIC__/static/common/js/area.js"></script>
<style type="text/css">

    textarea {border-left: 0;border-right: 0;border-top: 0;   border-bottom: 0;}
    /*input[type="text"] {border-style:none}*/
    /*input[type="number"] {border-style:none}*/
    select {border-style:none}

</style>

<div class="layui-form" lay-filter="layuiadmin-form-unit" id="layuiadmin-form-unit" style="padding: 20px 30px 0 0;">
    <input type="hidden" value="{$info.id}" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">真实名称：</label>
        <div class="layui-input-inline" style="width: 400px">
            <input readonly type="text" name="true_name" value="{$info.true_name}" lay-verify="required"
                   lay-vertype="tips" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">昵称：</label>
        <div class="layui-input-inline" style="width: 400px">
            <input readonly type="text" name="true_name" value="{$info.nick_name}"
                   lay-vertype="tips" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">粉丝数量：</label>
        <div class="layui-input-inline" style="width: 400px">
            <input readonly type="number" name="true_name" value="{$info.fans_num}"
                   lay-vertype="tips" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">性别：</label>
        <div class="layui-input-inline" style="width: 400px">
            {$info.sex == 1 ? '男' : ($info.sex == 2 ? '女' : '未知')}
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">手机号：</label>
        <div class="layui-input-inline" style="width: 400px">
            <input readonly type="text" name="tel_number" value="{$info.tel_number}" lay-verify="required"
                   lay-vertype="tips" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">微信号：</label>
        <div class="layui-input-inline" style="width: 400px">
            <input readonly type="text" name="wx_code" value="{$info.wx_code}" lay-verify="required" lay-vertype="tips"
                   placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">形象照：</label>
        <div class="layui-input-inline" style="width: 400px">
            {notempty name='$info.figure_image'}
            <img style="height:80px;width: 80px;margin-right: 10px;" class="image-show" src="{$info.figure_image}"
                 alt="">
            {/notempty}
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">抖音号：</label>
        <div class="layui-input-inline" style="width: 400px">
            <input readonly type="text" name="douyin_code" value="{$info.douyin_code}"
                   lay-vertype="tips" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">抖音截图：</label>
        <div class="layui-input-inline" style="width: 400px">
            {notempty name='$info.douyin_screen'}
            <img style="height:80px;width: 80px;margin-right: 10px;" class="image-show" src="{$info.douyin_screen}"
                 alt="">
            {/notempty}
            {notempty name='$info.douyin_screen2'}
            <img style="height:80px;width: 80px;margin-right: 10px;" class="image-show" src="{$info.douyin_screen2}"
                 alt="">
            {/notempty}
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">快手号：</label>
        <div class="layui-input-inline" style="width: 400px">
            <input readonly type="text" name="kuaishou_code" value="{$info.kuaishou_code}"
                   lay-vertype="tips"
                   placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">快手截图：</label>
        <div class="layui-input-inline" style="width: 400px">
            {notempty name='$info.kuaishou_screen'}
            <img style="height:80px;width: 80px;margin-right: 10px;" class="image-show" src="{$info.kuaishou_screen}"
                 alt="">
            {/notempty}
            {notempty name='$info.kuaishou_screen2'}
            <img style="height:80px;width: 80px;margin-right: 10px;" class="image-show" src="{$info.kuaishou_screen2}"
                 alt="">
            {/notempty}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">天猫号：</label>
        <div class="layui-input-inline" style="width: 400px">
            <input readonly type="text" name="tianmao_code" value="{$info.tianmao_code}"
                   lay-vertype="tips"
                   placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">天猫截图：</label>
        <div class="layui-input-inline" style="width: 400px">
            {notempty name='$info.tianmao_screen'}
            <img style="height:80px;width: 80px;margin-right: 10px;" class="image-show" src="{$info.tianmao_screen}"
                 alt="">
            {/notempty}
            {notempty name='$info.tianmao_screen2'}
            <img style="height:80px;width: 80px;margin-right: 10px;" class="image-show" src="{$info.tianmao_screen2}"
                 alt="">
            {/notempty}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="white-space: nowrap;">简介：</label>
        <div class="layui-input-inline" style="width: 400px">
            <textarea class="layui-textarea" readonly name="" id="" cols="30" rows="10">
                {$info.desc}
            </textarea>
        </div>
    </div>

    <input readonly type="hidden" name="user_id" value="{$info.user_id}" lay-verify="required"
           lay-vertype="tips" placeholder="" autocomplete="off" class="layui-input">

    <div class="layui-form-item" style="text-align: center">
        <button class="layui-btn layui-btn layui-btn" lay-submit lay-filter="thehost-submit-agree"
                lay-event="thehost-submit-agree">同意
        </button>
        <button class="layui-btn layui-btn-danger layui-btn" lay-submit lay-filter="thehost-submit-refuse"
                lay-event="thehost-submit-refuse">拒绝
        </button>
    </div>
</div>
<script>
    layui.config({
        version: "{$front_version}",
        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'like', 'form'], function () {
        var $ = layui.$, like = layui.like, form = layui.form;

        //图片放大
        $(document).on('click', '.image-show', function () {
            var src = $(this).attr('src');
            like.showImg(src, 600);
        });

        //监听提交
        form.on('submit(thehost-submit-agree)', function (data) {
            var id = data.field.id;
            var user_id = data.field.user_id;
            like.ajax({
                url: '{:url("theHost/audit")}',
                data: {id: id, status: "1", user_id: user_id},
                type: "post",
                success: function (res) {
                    if (res.code == 1) {
                        layui.layer.msg(res.msg, {
                            offset: '15px'
                            , icon: 1
                            , time: 1000
                        });
                        setTimeout(function () {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);//关闭当前页
                        }, 1500);

                    }
                    else {
                        layer.msg(res.msg, {
                            offset: '15px'
                            , icon: 2
                            , time: 1000
                        });
                    }
                }

            });
        });

        //监听提交
        form.on('submit(thehost-submit-refuse)', function (data) {
            var user_id = data.field.user_id;
            var id = data.field.id;
            var type = 2;

            like.ajax({
                url: '{:url("UserLogCopy/remarks")}'
                , data: {'id': id, 'type': type}
                , type: 'post'
                , success: function (res) {
                    if (res.code === 1) {
                        layer.prompt({
                            title: '备注信息',
                            formType: 2,
                            value: res.data.content
                        }, function (value, index) {
                            layer.close(index);
                            like.ajax({
                                url: '{:url("UserLogCopy/remarksAdd")}'
                                , data: {'id': id, "type": type, "content": value}
                                , type: 'post'
                                , success: function (res) {
                                    if (res.code === 1) {
                                        like.ajax({
                                            url: '{:url("theHost/audit")}',
                                            data: {id: id, status: "3", user_id: user_id},
                                            type: "post",
                                            success: function (res) {
                                                if (res.code == 1) {
                                                    layui.layer.msg(res.msg, {
                                                        offset: '15px'
                                                        , icon: 1
                                                        , time: 1000
                                                    });
                                                    setTimeout(function () {
                                                        var index = parent.layer.getFrameIndex(window.name);
                                                        parent.layer.close(index);//关闭当前页
                                                    }, 1500);
                                                }
                                                else {
                                                    layer.msg(res.msg, {
                                                        offset: '15px'
                                                        , icon: 2
                                                        , time: 1000
                                                    });
                                                }
                                            }

                                        });
                                    }
                                }
                            });

                        });
                    }
                }
            });
        });

    })
</script>